<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>申请退费</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <!-- 引入 layui.css -->
    <link rel="stylesheet" href="<%=request.getContextPath()%>/component/layui/css/layui.css">
    <!-- 引入 layui.js -->
    <script src="<%=request.getContextPath()%>/component/layui/layui.js"></script>
    <style>
        .site-title {
            margin: 30px 0 20px;
        }
        .site-title fieldset {
            border: none;
            padding: 0;
            border-top: 2px solid #00589f;
        }
        .site-title fieldset legend {
            margin-left: 20px;
            padding: 0 10px;
            font-size: 22px;
            font-weight: 300;
        }
        .layui-inline{
            margin:10px 0px;
        }
        .layui-tab-brief>.layui-tab-title .layui-this{
            color:#00589f;
        }
        .layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
            border-bottom: 2px solid #00589f;
        }
        .box1{
            border:1px solid #ccc;
        }
        .backcc{
            background:#ccc;
        }

    </style>
</head>
<body>

    <h1 style="height: 80px;line-height: 80px;text-align: center;background:#295DC2;color:#fff">申请退费</h1>
    <div class="layui-row" style="margin-top: 10px">
        <div class="layui-col-md-offset4 layui-col-md4 box1" >
            <form class="layui-form" action="<%=request.getContextPath()%>/BmRegistionServlet" method="post" id="ajaxForm" enctype = "multipart/form-data">
                <div class="layui-row site-title">
                    <fieldset>
                        <legend><a name="size">申请退费</a></legend>
                    </fieldset>
                </div>

                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        学生姓名
                    </label>
                    <div class="layui-input-block">
                        <input type="text" lay-verify="required"  autocomplete="off" placeholder="请输入学生姓名" value="${preRegistration.name}" disabled class="layui-input backcc">
                    </div>
                </div>

                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        身份证号
                    </label>
                    <div class="layui-input-block">
                        <input type="text" lay-verify="required"  autocomplete="off" placeholder="请输入学生姓名" value="${preRegistration.idCard}" disabled class="layui-input backcc">
                    </div>
                </div>

                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        报名序号
                    </label>
                    <div class="layui-input-block">
                        <input type="text"  lay-verify="required"  autocomplete="off" placeholder="请输入学生姓名" value="${preRegistration.graduateNo}" disabled class="layui-input backcc">
                    </div>
                </div>
                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        学费金额
                    </label>
                    <div class="layui-input-block">
                        <input type="number"  lay-verify="number"  autocomplete="off" placeholder="请输入学费金额"  value="${preLog.billMoney}" disabled class="layui-input backcc">
                    </div>
                </div>

                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        收款人姓名
                    </label>
                    <div class="layui-input-block">
                        <input type="text" name="contacts" lay-verify="required"  autocomplete="off" placeholder="请输入收款人姓名"   class="layui-input">
                    </div>
                </div>

                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        联系电话
                    </label>
                    <div class="layui-input-block">
                        <input type="text" name="phone" lay-verify="phone"  autocomplete="off" placeholder="请输入联系电话"   class="layui-input">
                    </div>
                </div>

                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        开户行
                    </label>
                    <div class="layui-input-block">
                        <input type="text" name="openBank" lay-verify="required"  autocomplete="off" placeholder="请输入银行卡号"   class="layui-input">
                    </div>
                </div>
                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        银行卡号
                    </label>
                    <div class="layui-input-block">
                        <input type="text" name="bankCard" lay-verify="number"  autocomplete="off" placeholder="请输入银行卡号"   class="layui-input">
                    </div>
                </div>

                <div class="layui-inline layui-col-sm11 ">
                    <label class="layui-form-label">
                        电子发票
                    </label>
                    <div class="layui-input-block">
                        <input type="file" name="file" lay-verify="required" autocomplete="off"  class="layui-input">
                    </div>
                </div>

                <div class="layui-row"style="margin: 20px;">
                    <br>
                    <input type="hidden" name="stuName" lay-verify="required"  value="${preRegistration.name}">
                    <input type="hidden" name="stuIdcard" lay-verify="required"  value="${preRegistration.idCard}">
                    <input type="hidden" name="graduateNo" lay-verify="required"  value="${preRegistration.graduateNo}">
                    <input type="hidden" name="fee" lay-verify="required"  value="${preLog.billMoney}">


                    <div class="layui-col-md12" >
                        <button lay-submit lay-filter="*" class="layui-btn layui-btn-radius layui-btn-fluid layui-btn-normal">提交退费申请</button>
                    </div>
                </div>

            </form>
        </div>

    </div>
    <script src="<%=request.getContextPath()%>/component/jquery.min.js"></script>
    <script src="<%=request.getContextPath()%>/component/ajaxForm.js"></script>
    <script>
        layui.use(['form', 'jquery','layer'], function () {
            let form = layui.form;
            let $ = layui.jquery;
            let layer = layui.layer;

            form.on('submit(*)', function (data) {
                var ifxg = confirm('确认退费吗？')
                if(ifxg){
                    $("#ajaxForm").ajaxSubmit({
                        type : 'post',
                        url : "<%=request.getContextPath()%>/common/refundStu",
                        dataType: 'json',
                        //data:  //注意只要是写在表单里面的，都不需要加这个属性。在controller中可以根据@RequestParam String str获取到属性值。
                        contentType : "application/x-www-form-urlencoded; charset=utf-8",
                        success: function(result) {
                            alert(result.msg)
                        },
                        error: function (data)//服务器响应失败处理函数
                        {
                            alert('返回数据不对')
                        }
                    });
                }
                return false;
            });
        })
    </script>
</body>
</html>
